FROM node:18.16.0 as builder
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH

COPY . ./

RUN npm install

RUN npm run build

FROM nginx:stable-alpine

COPY --from=builder /app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
